import 'package:goumao_app/Model/gm_article_model.dart';

class GMIndexModel {
  String? retCode;
  String? retDesc;
  List<GMIndexData>? data;
  List<GMArticleList>? article;

  GMIndexModel({this.retCode, this.retDesc, this.data, this.article});

  GMIndexModel.fromJson(Map<String, dynamic> json) {
    retCode = json['retCode'];
    retDesc = json['retDesc'];
    if (json['data'] != null) {
      data = <GMIndexData>[];
      json['data'].forEach((v) {
        data!.add(GMIndexData.fromJson(v));
      });
    }
    if (json['article'] != null) {
      article = <GMArticleList>[];
      json['article'].forEach((v) {
        article!.add(GMArticleList.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['retCode'] = retCode;
    data['retDesc'] = retDesc;
    if (this.data != null) {
      data['data'] = this.data!.map((v) => v.toJson()).toList();
    }
    if (article != null) {
      data['data'] = article!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class GMIndexData {
  String? brief;
  String? circleName;
  int? citeCount;
  String? coverImage;
  String? id;
  int? joinCount;
  List<String>? imgList;

  GMIndexData(
      {this.brief,
      this.circleName,
      this.citeCount,
      this.coverImage,
      this.id,
      this.joinCount,this.imgList});

  GMIndexData.fromJson(Map<String, dynamic> json) {
    brief = json['brief'];
    circleName = json['circleName'];
    citeCount = json['citeCount'];
    coverImage = json['coverImage'];
    id = json['id'];
    joinCount = json['joinCount'];
    imgList = json['imgList'].cast<String>();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['brief'] = brief;
    data['circleName'] = circleName;
    data['citeCount'] = citeCount;
    data['coverImage'] = coverImage;
    data['id'] = id;
    data['joinCount'] = joinCount;
    data['imgList'] = imgList;
    return data;
  }
}
